
import 'package:flutter/material.dart';

import 'UserInfoPage.dart';


class UserProfilePage extends StatelessWidget {
  const UserProfilePage({super.key});

  // void _navigateToNewPage(BuildContext context) {
  //   Navigator.push(
  //     context,
  //     MaterialPageRoute(builder: (context) => const NewPage()),
  //   );
  // }


  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: Column(
        children: [
          // 顶部背景图片
          Stack(
            children: [
              Container(
                height: 150.0,
                decoration: const BoxDecoration(
                  image: DecorationImage(
                    image: AssetImage('images/background.jpg'), // 背景图片
                    fit: BoxFit.cover,
                  ),
                ),
              ),
            ],
          ),
          const SizedBox(height: 15), // 调整头像和下面内容的间距
          Row(
            children: [
              const SizedBox(width: 20.0),
              GestureDetector(
                onTap: () {
                  // 点击头像时，跳转到用户信息页面
                  Navigator.push(
                    context,
                    MaterialPageRoute(builder: (context) => const UserInfoPage()),
                  );
                },
                child: const CircleAvatar(
                  radius: 40.0,
                  backgroundImage: AssetImage('images/avatar.jpg'), // 用户头像
                  backgroundColor: Colors.white,
                ),
              ),// 左侧间距
              const SizedBox(width: 15.0), // 头像与文本的间距
              const Column(
                crossAxisAlignment: CrossAxisAlignment.start,
                children: [
                  Text(
                    '陈林', // 昵称
                    style: TextStyle(fontSize: 20, fontWeight: FontWeight.bold),
                  ),
                  SizedBox(height: 4),
                  Text(
                    'QQ账号: 5120224490', // 用户账号
                    style: TextStyle(fontSize: 12, color: Colors.grey),
                  ),
                  SizedBox(height: 4),
                  Text(
                    'QQ等级: LV 47', // 用户等级
                    style: TextStyle(fontSize: 12, color: Colors.grey),
                  )
                ],
              ),
            ],
          ),
          const Divider(height: 25, thickness: 1.0),
          // 个人基本信息
          // const Padding(
          //   padding: EdgeInsets.symmetric(horizontal: 20.0),
          //   child: Column(
          //     crossAxisAlignment: CrossAxisAlignment.start,
          //     children: [
          //       Text(
          //         '基本信息',
          //         style: TextStyle(fontSize: 18, fontWeight: FontWeight.bold),
          //       ),
          //       SizedBox(height: 10),
          //       ListTile(
          //         leading: Icon(Icons.location_on, color: Colors.blue),
          //         title: Text('所在地: 北京'),
          //       ),
          //       ListTile(
          //         leading: Icon(Icons.school, color: Colors.blue),
          //         title: Text('学校: 北京大学'),
          //       ),
          //       ListTile(
          //         leading: Icon(Icons.cake, color: Colors.blue),
          //         title: Text('生日: 2006年01月01日'),
          //       ),
          //     ],
          //   ),
          // ),
          Expanded(
            child: ListView(
              padding: const EdgeInsets.symmetric(horizontal: 3.0),
              children: const [
                ListTile(
                  leading: Icon(Icons.star, color: Colors.blue),
                  title: Text('超级QQ秀'),
                  trailing: Icon(Icons.arrow_forward_ios, color: Colors.grey),
                  // onTap: () => _navigateToNewPage(context),// 点击跳转到对应页面
                ),
                ListTile(
                  leading: Icon(Icons.star_border, color: Colors.blue),
                  title: Text('SVIP最低至0.44元/天'),
                  trailing: Icon(Icons.arrow_forward_ios, color: Colors.grey),
                ),
                ListTile(
                  leading: Icon(Icons.account_balance_wallet, color: Colors.blue),
                  title: Text('我的QQ钱包'),
                  trailing: Icon(Icons.arrow_forward_ios, color: Colors.grey),
                ),
                ListTile(
                  leading: Icon(Icons.wallet_giftcard, color: Colors.blue),
                  title: Text('财富小金库'),
                  trailing: Icon(Icons.arrow_forward_ios, color: Colors.grey),
                ),
                ListTile(
                  leading: Icon(Icons.checkroom, color: Colors.blue),
                  title: Text('我的个性装扮'),
                  trailing: Icon(Icons.arrow_forward_ios, color: Colors.grey),
                ),
                ListTile(
                  leading: Icon(Icons.lock, color: Colors.blue),
                  title: Text('密室空间'),
                  trailing: Icon(Icons.arrow_forward_ios, color: Colors.grey),
                ),
                ListTile(
                  leading: Icon(Icons.signal_cellular_alt, color: Colors.blue),
                  title: Text('免流量送SVIP'),
                  trailing: Icon(Icons.arrow_forward_ios, color: Colors.grey),
                ),
                ListTile(
                  leading: Icon(Icons.book, color: Colors.blue),
                  title: Text('我的相册'),
                  trailing: Icon(Icons.arrow_forward_ios, color: Colors.grey),
                ),
                ListTile(
                  leading: Icon(Icons.star_border_outlined, color: Colors.blue),
                  title: Text('我的收藏'),
                  trailing: Icon(Icons.arrow_forward_ios, color: Colors.grey),
                ),
                ListTile(
                  leading: Icon(Icons.folder, color: Colors.blue),
                  title: Text('我的文件'),
                  trailing: Icon(Icons.arrow_forward_ios, color: Colors.grey),
                ),
              ],
            ),
          ),
          // 底部按钮
          Padding(
            padding: const EdgeInsets.symmetric(horizontal: 20.0, vertical: 10.0),
            child: Row(
              mainAxisAlignment: MainAxisAlignment.start, // 靠左对齐
              children: [
                TextButton(
                  onPressed: () {}, // 设置按钮的点击事件（当前不实现任何操作）
                  child: const Column(
                    children: [
                      Icon(Icons.settings, size: 20),
                      SizedBox(height: 4), // 图标和文字之间的间距
                      Text("设置", style: TextStyle(fontSize: 12)),
                    ],
                  ),
                ),
                const SizedBox(width: 5), // 按钮之间的间距
                TextButton(
                  onPressed: () {}, // 夜间按钮的点击事件（当前不实现任何操作）
                  child: const Column(
                    children: [
                      Icon(Icons.dark_mode, size: 20),
                      SizedBox(height: 4),
                      Text("夜间", style: TextStyle(fontSize: 12)),
                    ],
                  ),
                ),
                const SizedBox(width: 5), // 按钮之间的间距
                TextButton(
                  onPressed: () {}, // 天气按钮的点击事件（当前不实现任何操作）
                  child: const Column(
                    children: [
                      Icon(Icons.wb_sunny, size: 20),
                      SizedBox(height: 4),
                      Text("天气", style: TextStyle(fontSize: 12)),
                    ],
                  ),
                ),
              ],
            ),
          ),
        ],
      ),
    );
  }
}
